-- card: 3509 from stack: in -- bmap block id: 5838 -- flags: 4000 -- background id: 2588 -- name: Configure ----- HyperTalk script ----- on openCard if hilite of button "Above Bill Only" is true then show button "Amt. Due" show button "Prepare Above Bill" else hide button "Amt. Due" hide button "Prepare Above Bill" end if end openCard -- part 1 (button) -- low flags: 00 -- high flags: A003 -- rect: left=416 top=103 right=117 bottom=468 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: New ----- HyperTalk script ----- on mouseUp go to last card doMenu "New Card" end mouseUp -- part 2 (button) -- low flags: 00 -- high flags: A003 -- rect: left=352 top=130 right=146 bottom=474 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Time Slips ----- HyperTalk script ----- on mouseUp go to stack "Time Slips" end mouseUp -- part 3 (button) -- low flags: 00 -- high flags: A003 -- rect: left=352 top=159 right=176 bottom=474 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Disbursements ----- HyperTalk script ----- on mouseUp go to stack "Disbursements" end mouseUp -- part 5 (button) -- low flags: 80 -- high flags: A003 -- rect: left=352 top=219 right=238 bottom=474 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Amt. Due ----- HyperTalk script ----- on mouseUp global accumulateFees,accumulateDisb set lockScreen to true set cursor to 4 push card put card field "Client Number" into clNum if clNum is empty then ask "Please enter an Account Number" put it into clNum if it is empty then exit mouseUp end if go to card clNum send mouseUp to bkgnd button "Amt. Due" pop card put "Balance Outstanding:" into line 1 of card field "Descrip" put "Fees: $" & accumulateFees into line 2 of card field "Descrip" put "Disbursements: $" & accumulateDisb into line 3 of card field "Descrip" end mouseUp -- part 6 (button) -- low flags: 80 -- high flags: A003 -- rect: left=352 top=251 right=270 bottom=474 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Prepare Above Bill ----- HyperTalk script ----- on mouseUp global thisCard,clNumber,atty,hrs,rte,totfees,header,bodyofBill,bodyofDisb, accumulateFees, accumulateDisb put card field "Client Number" into thisCard set lockRecent to true set lockScreen to true set lockMessages to true set cursor to 4 checkConfiguration constructHeader assembleFees assembleDisbursements writeBill set lockRecent to false set lockScreen to false set lockMessages to false play boing end mouseUp on checkConfiguration -- SET FLAGS FOR BILLING FORMAT; APPARENTLY, THIS MUST BE DONE BEFORE -- SWITCHING TO ANOTHER STACK global atty,hrs,rte,totfees get hilite of button "Hours" of card "Configure" if it is true then put "true" into hrs else put "false" into hrs end if get hilite of button "Rate" of card "Configure" if it is true then put "true" into rte else put "false" into rte end if get hilite of button "Total Fees" of card "Configure" if it is true then put "true" into totfees else put "false" into totfees end if get hilite of button "Attorney" of card "Configure" if it is true then put "true" into atty else put "false" into atty end if end checkConfiguration on constructHeader -- CONSTRUCT LETTERHEAD AND MAILING ADDRESS INFORMATION global thisCard,header,clNumber push card go to card thisCard put return & return & return & tab & tab & tab & "Peter B. Nagel" & return into header put tab & tab & tab & "710 Dahlia Street" & return after header put tab & tab & tab & "Denver, Colorado 80220" & return after header put tab & tab & tab & "CompuServe 75036,3423" & return after header put field "Client Name" into clName put field "Address" into clAddress put field "Matter" into clMatter put field "Client Number" into clNumber put return & return & return & clName & tab & tab & "Client Number: " & clNumber & return after header put clAddress & return & return after header put "Re: " & clMatter & return & return & return after header put "STATEMENT OF SERVICES RENDERED AS OF " & the long date & ":" & return after header end constructHeader on assembleFees -- ASSEMBLE DESCRIPTION OF SERVICES RENDERED AND OUTSTANDING FEES global clNumber,atty,hrs,rte,totfees,bodyofBill,accumulateFees go to stack "Time Slips" put field "Attorney Name" of card "Cover Card" into attyName put 0 into accumulateFees -- needs to be initialized set numberFormat to 0.00 add 0 to accumulateFees -- to trigger number format put empty into bodyofBill -- initialization repeat with x = 2 to the number of cards go to card x if field "Client Number" contains clNumber then add field "Total Bill" to accumulateFees put return & return & field "Date" & ":" & return & field "Narrative" & return after bodyofBill if atty contains true then -- if "Attorney" format was selected put tab & attyName after bodyofBill end if if hrs contains true then -- if "Hours" format was selected put space && space && field "Total Time" && "hours" after bodyofBill end if if rte contains true then -- if "Rate" format was selected put space && space && "$" & field "Hourly" && "per hour" after bodyofBill end if if totfees contains true then -- if "Fees" format was selected put space && space && "$" & field "Total Bill" after bodyofBill end if end if end repeat end assembleFees on assembleDisbursements -- ASSEMBLE INFORMATION ABOUT EXPENSES INCURRED global clNumber,bodyofDisb,accumulateDisb go to stack "Disbursements" put 0 into accumulateDisb -- needs to be initialized set numberFormat to 0.00 add 0 to accumulateDisb -- to trigger number format put empty into bodyofDisb -- initialization repeat with x = 2 to the number of cards go to card x if field "Client Number" contains clNumber then add field "Total Disb" to accumulateDisb put field "Description" into descripHolder -- don't alter field repeat for (40-the number of chars of descripHolder) times put space after descripHolder end repeat -- extends "Description" field out to 40 characters -- so that dollar entries will line up properly put field "Date" & ":" & return & descripHolder & "$" & field "Total Disb" & return & return after bodyofDisb end if end repeat pop card end assembleDisbursements on writeBill global clNumber,header,bodyofBill,bodyofDisb, accumulateFees,accumulateDisb --FIRST PUT TOTAL BALANCES DUE IN DESCRIPTION FIELD OF CARD put "Balance Outstanding:" into line 1 of card field "Descrip" -- just to show balance on client card put "Fees: $" & accumulateFees into line 2 of card field "Descrip" put "Disbursements: $" & accumulateDisb into line 3 of card field "Descrip" --SEND BILLING INFORMATION TO TEXT FILE FOR EDITING --NOTE THAT THIS WILL SAVE BILL IN SAME FOLDER AS THIS STACK get the long name of this stack -- includes full pathname put it into preBill delete first word of preBill -- deletes "stack" delete first char of preBill -- deletes initial ' " ' delete last char of preBill -- deletes final ' " ' repeat two times delete last word of preBill -- deletes "Client List" end repeat repeat 6 times delete last char of preBill -- deletes "Master" end repeat put clNumber & " Bill" after preBill -- name of new text document open file preBill write header to file preBill -- starts with client address & matter write bodyofBill to file preBill write return & return & return & return & "DISBURSEMENTS:" & return & return to file preBill write bodyofDisb to file preBill write return & return & return & "TOTAL FEES: $" & accumulateFees to file preBill write return & return & "TOTAL DISBURSEMENTS: $" & accumulateDisb to file preBill write return & return & "TOTAL AMOUNT DUE: $" & accumulateFees + accumulateDisb to file preBill close file preBill end writeBill -- part 7 (button) -- low flags: 00 -- high flags: A003 -- rect: left=352 top=282 right=301 bottom=474 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Prepare All Bills ----- HyperTalk script ----- on mouseUp push card show msg at 17,246 put "Now preparing bills for all clients. This may take a while." --set lockScreen to true set lockMessages to true repeat with x = 2 to the number of cards go to card x send mouseUp to bkgnd button "Prepare Bill" end repeat pop card hide msg --set lockScreen to false set lockMessages to false beep 3 wait 20 ticks beep 3 end mouseUp -- part 12 (button) -- low flags: 00 -- high flags: A006 -- rect: left=37 top=220 right=236 bottom=153 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: All Bills ----- HyperTalk script ----- on mouseUp if hilite of me is true then set hilite of button "Above Bill Only" to false hide button "Amt. Due" hide button "Prepare Above Bill" hide card field "Descrip" end mouseUp -- part 13 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=38 top=113 right=127 bottom=142 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Client Number ----- HyperTalk script ----- on closeField put card field "Client Number" into clNum push card set lockScreen to true set cursor to 4 go to card clNum put line 1 of field "Client Name" into clNme put field "Matter" into clMatter pop card put clNme into card field "Client Name" put clMatter into card field "Matter" hide msg set lockText of me to true end closeField on mouseUp set the lockText of me to false get the mouseloc repeat 2 times click at it end repeat put the selection into holder set the lockText of me to true go to card holder end mouseUp -- part 14 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=38 top=145 right=159 bottom=279 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Client Name ----- HyperTalk script ----- on closeField put card field "Client Name" into clName push card set cursor to 4 repeat with x = 2 to the number of cards go to card x if field "Client Name" contains clName then answer "Use this client account number?" with "No" or "Yes" if it is "Yes" then put field "Client Name" into clName put field "Matter" into clMatter put field "Client Number" into clNumber pop card put clNumber into card field "Client Number" put clName into card field "Client Name" put clMatter into card field "Matter" hide msg exit closeField else next repeat end if end repeat pop card put "You don't have an account under that name. Please check your typing." end closeField -- part 15 (button) -- low flags: 00 -- high flags: A006 -- rect: left=37 top=237 right=253 bottom=153 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Above Bill Only ----- HyperTalk script ----- on mouseDown if card field "Client Name" is empty then set hilite of me to false show msg at 12,200 put "Please enter either a Client Name or an Account Number." end if end mouseDown on mouseUp if hilite of me is true then set hilite of button "All Bills" to false show button "Amt. Due" show button "Prepare Above Bill" show card field "Descrip" else hide button "Amt. Due" hide button "Prepare Above Bill" hide card field "Descrip" end if end mouseUp -- part 16 (button) -- low flags: 00 -- high flags: A005 -- rect: left=55 top=254 right=270 bottom=153 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Attorney ----- HyperTalk script ----- on mouseUp end mouseUp -- part 17 (button) -- low flags: 00 -- high flags: A005 -- rect: left=55 top=271 right=287 bottom=153 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Hours -- part 18 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=38 top=178 right=192 bottom=279 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Matter -- part 19 (button) -- low flags: 00 -- high flags: A003 -- rect: left=356 top=103 right=117 bottom=404 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Sort ----- HyperTalk script ----- on mouseUp sort by field "Client Number" end mouseUp -- part 20 (field) -- low flags: 81 -- high flags: 0000 -- rect: left=179 top=284 right=321 bottom=309 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Descrip -- part 22 (button) -- low flags: 00 -- high flags: A005 -- rect: left=55 top=288 right=304 bottom=153 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Rate -- part 23 (button) -- low flags: 00 -- high flags: A005 -- rect: left=55 top=305 right=321 bottom=153 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Total Fees -- part 60 (button) -- low flags: 00 -- high flags: A003 -- rect: left=375 top=312 right=328 bottom=456 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Clear All ----- HyperTalk script ----- on mouseUp repeat with x = 1 to 4 put empty into card field x end repeat repeat with y = 7 to 13 set hilite of button y to false end repeat set lockText of card field "Client Number" to false set hilite of button 18 to false hide button 4 hide button 5 end mouseUp -- part 24 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=469 top=311 right=330 bottom=494 -- title width / last selected line: 0 -- icon id / first selected line: 16560 / 16560 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Next ----- HyperTalk script ----- on mouseUp visual effect wipe left go to next card end mouseUp -- part 25 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=13 top=312 right=330 bottom=38 -- title width / last selected line: 0 -- icon id / first selected line: 15420 / 15420 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Prev ----- HyperTalk script ----- on mouseUp visual effect wipe right go to previous card end mouseUp -- part 67 (button) -- low flags: 00 -- high flags: E006 -- rect: left=182 top=220 right=236 bottom=319 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Quarter Hours ----- HyperTalk script ----- on mouseUp if hilite of me is true then set hilite of button "Ten Minute Intervals" to false set lockScreen to true set cursor to 4 push card go to next card get the script of bkgnd button "Adjust Fees" put it into temp4 put "send " & quote & "computeBill quarterHours" & quote && "to target" into line 16 of temp4 set the script of bkgnd button "Adjust Fees" to temp4 set lockScreen to true go to stack "Time Slips" get the script of bkgnd button "End" put it into temp1 put "computeBill " & quote & "quarterHours" & quote into line 3 of temp1 set script of bkgnd button "End" to temp1 get the script of bkgnd button "New" put it into temp2 put "computeBill " & quote & "quarterHours" & quote into line 4 of temp2 set the script of bkgnd button "New" to temp2 get the script of bkgnd field "End Time" put it into temp3 put "computeBill " & quote & "quarterHours" & quote into line 2 of temp3 set the script of bkgnd field "End Time" to temp3 set lockScreen to false pop card end if end mouseUp -- part 68 (button) -- low flags: 00 -- high flags: A006 -- rect: left=182 top=237 right=253 bottom=319 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Ten Minute Intervals ----- HyperTalk script ----- on mouseUp if hilite of me is true then set hilite of button "Quarter Hours" to false set lockScreen to true set cursor to 4 push card go to next card get the script of bkgnd button "Adjust Fees" put it into temp4 put "send " & quote & "computeBill tenMinutes" & quote && "to target" into line 16 of temp4 set the script of bkgnd button "Adjust Fees" to temp4 set lockScreen to true go to stack "Time Slips" get the script of bkgnd button "End" put it into temp1 put "computeBill " & quote & "tenMinutes" & quote into line 3 of temp1 set script of bkgnd button "End" to temp1 get the script of bkgnd button "New" put it into temp2 put "computeBill " & quote & "tenMinutes" & quote into line 4 of temp2 set the script of bkgnd button "New" to temp2 get the script of bkgnd field "End Time" put it into temp3 put "computeBill " & quote & "tenMinutes" & quote into line 2 of temp3 set the script of bkgnd field "End Time" to temp3 pop card set lockScreen to false end if end mouseUp -- part contents for background part 7 ----- text ----- ©Copyright 1987 by Peter B. Nagel -- part contents for background part 19 ----- text ----- Peter B. Nagel